#include <iostream>
using namespace std;


int main()
{
	int q;
	int a, b, c;
	cin >> q;
	while (q--)
	{
		cin >> a >> b >> c;
		int x = min(a, min(b, c));
		cout << (x * 2 + max(b - x - 1, 0)) << endl;
	}
	return 0;
}